<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<title>appscript | 5. Keyword Conversion</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css" media="all"><!--@import url(full.css);--></style>

</head>
<body>

<h1>5. Keyword Conversion</h1>

<!-- top navigation -->
<div class="navbar">
	<a href="04_gettinghelp.html">Previous</a> | <a href="index.html">Up</a> | <a href="06_classesandenums.html">Next</a>
	
</div>

<!-- content -->
<div id="content">
<h2>Keyword conversion</h2>

<p>Because application terminology resources specify AppleScript-style keywords for class, property, command, etc. names, appscript uses the following rules to translate these keywords to legal Ruby identifiers:</p>

<ul>
<li>Characters a-z, A-Z, 0-9 and underscores (_) are preserved.</li>

<li>Spaces, hyphens (-) and forward slashes (/) are removed, and the first character of all but the first word is capitalised, e.g. <code>document file</code> is converted to <code>documentFile</code>.</li>

<li>Ampersands (&amp;) are replaced by the word 'And'.</li>

<li>All other characters are converted to 0x00-style hexadecimal representations.</li>

<li>Names that begin with '_' or 'AS_' have an underscore appended.</li>

<li>Names that match ObjC keywords or methods already defined on appscript's Application and Reference classes have an underscore appended. The reserved method names are:

<pre><code>abortTransaction                        initWithPID
after                                   initWithSignature
alloc                                   initWithURL
allocWithZone                           instanceMethodForSelector
AND                                     instanceMethodSignatureForSelector
any                                     instancesRespondToSelector
attributeKeys                           int
auto                                    inverseForRelationshipKey
awakeAfterUsingCoder                    isIn
before                                  isNotIn
BOOL                                    isSubclassOfClass
break                                   last
cancelPreviousPerformRequestsWithTarget load
case                                    long
char                                    methodForSelector
Class                                   methodSignatureForSelector
class                                   middle
classCode                               mutableCopy
classDescription                        mutableCopyWithZone
classFallbacksForKeyedArchiver          new
classForArchiver                        next
classForCoder                           nil
classForKeyedArchiver                   NIL
classForKeyedUnarchiver                 NO
classForPortCoder                       NOT
className                               OR
conformsToProtocol                      poseAsClass
const                                   previous
contains                                queueReply
continue                                register
copy                                    replacementObjectForArchiver
copyWithZone                            replacementObjectForCoder
dealloc                                 replacementObjectForKeyedArchiver
default                                 replacementObjectForPortCoder
description                             resultType
do                                      return
doesNotContain                          returnID
doesNotEndWith                          scriptingProperties
doesNotRecognizeSelector                SEL
doesNotStartWith                        self
double                                  setScriptingProperties
else                                    setVersion
end                                     short
endsWith                                signed
endTransaction                          sizeof
enum                                    start
extern                                  startsWith
finalize                                startTransaction
first                                   static
float                                   struct
for                                     super
forwardInvocation                       superclass
goto                                    switch
help                                    timeout
ID                                      toManyRelationshipKeys
id                                      toOneRelationshipKeys
if                                      typedef
ignore                                  union
ignoreReply                             unsigned
IMP                                     version
init                                    void
initialize                              volatile
initWithBundleID                        waitReply
initWithDescriptor                      while
initWithName                            YES
initWithPath</code></pre>
</div>
</li>
</ul>

<!-- bottom navigation -->
<div class="navbar">
	<a href="04_gettinghelp.html">Previous</a> | <a href="index.html">Up</a> | <a href="06_classesandenums.html">Next</a>
	
</div>

<!--footer-->
<p class="footer">&copy; 2007 HAS</p>
</body>
</html>